"""
#!/usr/bin/python3
# coding:utf-8            
#
# Copyright (C) 2024 - 2024 Jasonakeke， Inc. All Rights Reserved 
# @Desc	   ：
# @Time    : 2024/11/3 21:02
# @Author  : Code_By_Jasonakeke
# @Email   : 2284037977@qq.com
# @File    : __init__.py.py
# @IDE     : PyCharm
"""
from flask import Flask

from Shopping.resources.user import user_bp
from comment.utils.logging import create_logger
from settings import map_config

# 负责创建 APP
def create_app(config_type):
	app = Flask(__name__)
	# 加载项目配置
	app.config.from_object(map_config.get(config_type))

	# 加载日志处理工具
	create_logger(app)
	# 初始化 SQLALchemy
	from comment.models import db
	db.init_app(app)
	# 加载模块的蓝图
	app.register_blueprint(user_bp)
	return app
